﻿using NDI;
using Services4KouDai.Services;

namespace Services4KouDai
{
    public class ServiceModule
    {
        public static Container ServiceContainer;

        public static void Init(ContainerBuilder builder)
        {
            builder.Register<IHoneyService>(c => new HoneyService()).ReuseWithin(ReuseScope.Container).OwnedBy(Owner.Container);
            builder.Register<IGroupCombineService>(c => new GroupCombineService()).ReuseWithin(ReuseScope.Container).OwnedBy(Owner.Container);
            builder.Register<IGoodShopListService>(c => new GoodShopListService()).ReuseWithin(ReuseScope.Container).OwnedBy(Owner.Container);
            builder.Register<IGoodsDetailService>(c => new GoodsDetailService()).ReuseWithin(ReuseScope.Container).OwnedBy(Owner.Container);

            ServiceContainer = builder.Build();
        }
    }
}
